<% form_remote_tag(:url => {:controller => 'auth', :action => params[:act]}, :loading => "TrackSuite.ajax.loadding('user_submit','ajax20.gif');") do %>
<%= hidden_field_tag "act", params[:act] %>  
<%= hidden_field "user", "id" %>
<%= error_messages_for "user" %>
<table border="1">
<thead>
    <tr><td>Todos os campos são obrigatórios.</td></tr>
</thead>
<tbody>
    <tr><td>Nome:</td></tr>
    <tr><td><%= text_field "user", "name" %></td></tr>
    <tr><td>E-mail:</td></tr>
    <% if @user.new_record? then %>
    <tr><td><%= text_field "user", "email" %></td></tr>
    <% else %>
    <tr><td><%= text_field "user", "email" , {:disabled => 'true'}%></td></tr>
    <% end %>
    <tr><td>Status:</td></tr>
    <tr><td><%= select "user", "status", [["Ativo", true], ["Desativado", false]] %></td></tr>
    <% if @user.new_record? or params[:alterpass] == 'true' then %>
    <%= hidden_field_tag "alterpass", params[:alterpass] %>
    <tr><td>Senha:</td></tr>
    <tr><td><%= password_field "user", "pass" %></td></tr>
    <tr><td>Confirmação de Senha:</td></tr>
    <tr><td><%= password_field "user", "pass_confirmation" %></td></tr>
    <% end %>
</tbody>
<tfoot>
    <tr>
        <td colspan="4" align="right">
          <span id="user_submit"><%= image_submit_tag "/images/icons/ok.png" %></span> 
          <%= link_to_function(image_tag("/images/icons/cancel.png", :border => "0"), "TrackSuite.util.element.hide('user_form')") %>
        </td>
    </tr>
</tfoot>
</table>
<% end %>
